﻿@model shop.SanPham

@{
    ViewBag.Title = "Thêm sản phẩm";
    Layout="~/Views/Shared/_layoutAdmin.cshtml";       
}
<script type="text/javascript" src="@Url.Content("~/plugin/ckEditor/ckeditor.js")"></script>
<link href="@Url.Content("~/Plugin/Uploadify/uploadify.css")" rel="stylesheet" />
<script src="@Url.Content("~/Plugin/Uploadify/jquery.uploadify.js")"></script>
<div class="content-module-heading cf">

    <h3 class="fl">Thêm sản Phẩm</h3>
</div> <!-- end content-module-heading -->
<div class="content-module-main cf">
    <div class="half-size-column fl">
        @using (Html.BeginForm("create", "sanpham", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            @Html.AntiForgeryToken()
            @Html.ValidationSummary(true)
            <p>
                <label>Tên  sản phẩm</label>
                <div class="editor-field">
                    @Html.EditorFor(model => model.TenSP, new { @class = "round default-width-input" })
                    @Html.ValidationMessageFor(model => model.TenSP)
                </div>
            </p>
            <p>
               <div class="editor-label">
                  <label> Giá tiền</label>
               </div>
               <div class="editor-field">
                   @Html.EditorFor(model => model.Gia)
                   @Html.ValidationMessageFor(model => model.Gia)
               </div>

           </p>

           
            
            <p>
                <div class="editor-label">
                  <label> Thuộc nghề nhiệp</label> 
                </div>
                <div class="editor-field">
                    @Html.Action("dropnn", "Partial", new { type = "2" })
                    @Html.ValidationMessageFor(model => model.MaNN)
                </div>
            </p>
            <p>

               <div class="editor-label">
                  <label> Thương hiệu</label>
               </div>
               <div class="editor-field">
                   @Html.Action("dropthTH", "Partial", new { type = "2" })
                   @Html.ValidationMessageFor(model => model.MaTH)
               </div>
           </p>
            <p>
                <div class="editor-label">
                  <label> Danh mục</label> 
                </div>
                <div class="editor-field">
                    @Html.Action("dropdm", "Partial", new { type = "2" })
                    @Html.ValidationMessageFor(model => model.MaDM)
                </div>

            </p>
            <p>
                <div class="editor-label">
                    <label>Hình Ảnh</label>
                </div>
                <div class="editor-field">
                    <input type="file" name="anhsp" />
                </div>
            </p>
           
       

            <p>
                <input id="add" type="submit" value="Thêm" />
            </p>

        }
        
</div>
    <div class="half-size-column fr">
        <p>
            <div class="editor-label">
                <label> Nội dung sản phẩm</label>
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(model => model.NoiDung, new { @id = "noidungsanpham" })
                @Html.ValidationMessageFor(model => model.NoiDung)
                <script type="text/javascript">
                    CKEDITOR.replace("noidungsanpham", {
                        toolbar: [
                            { name: 'document', items: ['-', 'NewPage', 'Preview', '-', 'Templates'] },	// Defines toolbar group with name (used to create voice label) and items in 3 subgroups.
                            ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'],			// Defines toolbar group without name.
                            '/',																					// Line break - next group will be placed in new line.
                            { name: 'basicstyles', items: ['Bold', 'Italic'] }
                        ]
                    });
                </script>
            </div>

        </p>
    </div>
</div>

<script>
    $(document).ready(function () {

        $('#TenSP').addClass('round default-width-input');
        $('TextArea').addClass('round full-width-textarea');
        $('#add').addClass('button round blue image-right ic-add text-upper');
    });
</script>